<?php
/**
 * Created by PhpStorm.
 * User: wangwenfan
 * Date: 16-11-1
 * Time: 下午4:30
 */

namespace Home\Controller;
use Think\Controller;

class AdminController extends Controller
{

    public function _initialize(){
        // 获取当前用户ID
        if(defined('UID')) return ;
        define('UID',is_login());
        if( !UID ){// 还没登录 跳转到登录页面
            $this->redirect('Public/login');
        }
    }
}